package com.bluesky.plum.uimodels.basic;

import java.util.Date;

import com.bluesky.plum.richdomain.FieldType;
import com.bluesky.plum.richdomain.RichDomainField;
import com.bluesky.plum.uimodels.standard.UIComponent;
import com.bluesky.plum.uimodels.standard.components.CheckBox;
import com.bluesky.plum.uimodels.standard.components.DateTimePicker;
import com.bluesky.plum.uimodels.standard.components.ListBox;
import com.bluesky.plum.uimodels.standard.components.SpinBox;
import com.bluesky.plum.uimodels.standard.components.TextBox;

public class BasicUIComponentBuilder {

	public static UIComponent CreateComponent(RichDomainField field) {
		switch (field.fieldType) {
		case Boolean:
			return new CheckBox(field);
		case Integer:
			return new SpinBox(field);
		case String:
			return new TextBox(field);
		case DateTime:
			return new DateTimePicker(field);
		case ObjectReference:
			return new ListBox();
		default:
			return null;

		}

	}

}
